Enable continuous backup for AllVersionsAndDeletes tests - #4901
Enable continuous backup for AllVersionsAndDeletes tests#4901NaluTripician wants to merge 4 commits into
Conversation
Add enableContinuousBackup parameter to test-resources.bicep to configure continuous backup policy when needed. Add a new account configuration in live-platform-matrix.json for AllVersionsAndDeletes change feed tests that enables continuous backup. This fixes the live tests for PR Azure#4706 that require continuous backup to be enabled for the AllVersionsAndDeletes change feed mode to function properly. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: f2f63ad0-37fe-4d65-a2a3-0329ae6cb793
d9f38da to
d87da5a
Compare
There was a problem hiding this comment.
Pull request overview
Adds continuous-backup provisioning intended for AllVersionsAndDeletes live tests.
Changes:
- Adds an opt-in Cosmos DB backup policy.
- Adds a dedicated continuous-backup test matrix entry.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
sdk/cosmos/test-resources.bicep |
Configures periodic or continuous backups. |
sdk/cosmos/live-platform-matrix.json |
Adds the AllVersionsAndDeletes test account. |
Comments suppressed due to low confidence (1)
sdk/cosmos/test-resources.bicep:84
continuousTierPolicyis not part of the2023-04-15database-account backup policy schema, so this account deployment will fail instead of enabling continuous backup. Continuous policies usecontinuousModeProperties.tier(the existing base implementation usesContinuous7Days).
disableKeyBasedMetadataWriteAccess: false
enableFreeTier: false
enableAnalyticalStorage: false
|
/azp run rust - cosmos - weekly |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (2)
sdk/cosmos/live-platform-matrix.json:57
- This category does not enable any of the intended tests. The three AllVersionsAndDeletes live tests are currently ignored unless
test_category = "emulator"(cosmos_change_feed.rs:730-733, 859-862, 960-963), while this value is exported directly asCOSMOS_RUSTFLAGS; therefore this matrix entry provisions the account but skips all three tests. Addall_versions_and_deletesto those tests'cfg_attrgates (or use an existing category that enables them).
"ArmTemplateParameters": "@{ defaultConsistencyLevel = 'Session'; enableContinuousBackup = $true; testCategory = 'all_versions_and_deletes' }"
sdk/cosmos/test-resources.bicep:60
continuousTierPolicyis not a property of theMicrosoft.DocumentDB/databaseAccounts@2023-04-15backup-policy schema, so this configuration is not a valid way to select continuous backup. Restore the supportedcontinuousModeProperties.tiershape; otherwise Bicep/ARM can reject or ignore this setting instead of provisioning the intended policy.
continuousTierPolicy: {
state: 'On'
}
… backup policy The continuousTierPolicy property does not exist in the Azure API version 2023-04-15. The correct property for continuous backup mode is continuousModeProperties with tier set to 'Continuous7Days', which matches the structure used in the merged PR Azure#4706. Addresses review comment on incorrect backup policy schema.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
sdk/cosmos/live-platform-matrix.json:57
- This category does not enable the intended tests.
test-resources.bicep:138emits it as--cfg=test_category="all_versions_and_deletes", but there are no tests gated on that value; the three AllVersionsAndDeletes live tests are still gated exclusively ontest_category = "emulator"(cosmos_change_feed.rs:731,:860, and:961). Consequently this new matrix leg provisions the continuous-backup account and then skips every test it was added for. Either make those guards accept the new category or use a category that currently enables them.
"ArmTemplateParameters": "@{ defaultConsistencyLevel = 'Session'; enableContinuousBackup = $true; testCategory = 'all_versions_and_deletes' }"
|
/azp run rust - cosmos - weekly |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
…etes category The three AllVersionsAndDeletes change feed tests were incorrectly gated to run on emulator, but they require continuous backup which the emulator doesn't support. Changed test gating from 'emulator' to 'all_versions_and_deletes' so these tests only run on live accounts with continuous backup enabled. - all_versions_and_deletes_surfaces_create_replace_delete - all_versions_and_deletes_fans_out_creates_across_partitions - all_versions_and_deletes_rejects_point_in_time_start This fixes the HTTP 400 errors on DocumentCollection creation in CI. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 708004fe-cc4b-4721-969f-a7661c2a1ce1
The AllVersionsAndDeletes change feed tests now use the 'all_versions_and_deletes' test category to gate to live accounts with continuous backup. This category needs to be registered in build.rs so the Rust compiler recognizes it. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 708004fe-cc4b-4721-969f-a7661c2a1ce1
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (3)
sdk/cosmos/azure_data_cosmos/tests/emulator_tests/cosmos_change_feed.rs:861
- The preceding documentation still says this test is gated on
test_category = "emulator", which contradicts the newall_versions_and_deletesgate. Update it to state that the test requires the live continuous-backup account.
not(test_category = "all_versions_and_deletes"),
ignore = "requires test_category 'all_versions_and_deletes' (requires live account with continuous backup enabled)"
sdk/cosmos/azure_data_cosmos/tests/emulator_tests/cosmos_change_feed.rs:962
- The preceding documentation still says this test is gated on
test_category = "emulator", which contradicts the newall_versions_and_deletesgate. Update it to state that the test requires the live continuous-backup account.
not(test_category = "all_versions_and_deletes"),
ignore = "requires test_category 'all_versions_and_deletes' (requires live account with continuous backup enabled)"
sdk/cosmos/azure_data_cosmos/tests/emulator_tests/cosmos_change_feed.rs:732
- The gate now makes this test live-only, but its documentation still says
test_category = "emulator"and the body still describes emulator-specific behavior (for example, the retention and pre-image comments). Update those references to describe the live continuous-backup account so the prerequisites and assertion rationale match how the test runs.
This issue also appears in the following locations of the same file:
- line 860
- line 961
not(test_category = "all_versions_and_deletes"),
ignore = "requires test_category 'all_versions_and_deletes' (requires live account with continuous backup enabled)"
|
/azp run rust - cosmos - weekly |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Add support for enabling continuous backup on Cosmos DB test accounts to support the AllVersionsAndDeletes change feed mode added in PR #4706.
Changes
Related Issue
Fixes #4706 - The live tests for AllVersionsAndDeletes change feed mode require continuous backup to be enabled on the test account